You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Dew.Stats.Units Namespace > Classes > Statistics Class > Statistics Methods > Covariance Method > Statistics.Covariance Method ([In] TVec, out double, bool)
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
Statistics.Covariance Method ([In] TVec, out double, bool)

Covariance/variance.

Syntax
C#
Visual Basic
public static void Covariance([In] TVec X, out double aResult, bool NormN);
Parameters 
Description 
[In] TVec X 
Defines sample (variable) values (observables). In this case X is treated as row and not (as normally) column vector. 
out double aResult 
Returns the covariance (in this case equal to variance) for X vector elements. Because in this case X is represented as row vectro, the the result is simply scalar value E(X(T)*X)-E(X(T))E(X) = Var(X)
bool NormN 
If true (default value), the result will be normalized with number of observations (N), otherwise it will be normalized with N-1

The covariance between two real-valued random variables x and y,with expected values E(x)=mu and E(y)=nu is defined as:  

 

 

where E(x), E(y) are x and y expected values. 

For more info about covariance definition and properties check thd following links: 

 

  1. http://mathworld.wolfram.com/Covariance.html 

  2. http://en.wikipedia.org/wiki/Covariance
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!